public class work04 {

    public static void main(String[] args) {
        String []names={"张一","张二","张张","啦啦啦","哟哟哟"};
        int count=0;
        for (int i=0;i<names.length;i++){
            if (names[i].indexOf("张")==0){
                count++;
            }
        }
        System.out.println("姓张的人数："+count);
    }
}
